Integrand size = 21, antiderivative size = 434 \[ \int \cos ^4(c+d x) (a+b \tan (c+d x))^n \, dx=\frac {b \left (\frac {a \left (5+\frac {3 a^2}{b^2}-2 n\right ) n}{b^2}-\frac {\sqrt {-b^2} \left (3 a^4+a^2 b^2 \left (6-2 n-n^2\right )+b^4 \left (3-4 n+n^2\right )\right )}{b^6}\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{16 \left (1+\frac {a^2}{b^2}\right )^2 \left (a-\sqrt {-b^2}\right ) d (1+n)}+\frac {b \left (\frac {a \left (5+\frac {3 a^2}{b^2}-2 n\right ) n}{b^2}+\frac {\sqrt {-b^2} \left (3 a^4+a^2 b^2 \left (6-2 n-n^2\right )+b^4 \left (3-4 n+n^2\right )\right )}{b^6}\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{16 \left (1+\frac {a^2}{b^2}\right )^2 \left (a+\sqrt {-b^2}\right ) d (1+n)}+\frac {\cos ^4(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{4 \left (a^2+b^2\right ) d}+\frac {b \cos ^2(c+d x) (a+b \tan (c+d x))^{1+n} \left (b^2 (3-n)+a^2 (1+n)+a b \left (5+\frac {3 a^2}{b^2}-2 n\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d} \]
[Out]
Time = 0.86 (sec) , antiderivative size = 434, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3587, 755, 837, 845, 70} \[ \int \cos ^4(c+d x) (a+b \tan (c+d x))^n \, dx=\frac {\cos ^4(c+d x) (a \tan (c+d x)+b) (a+b \tan (c+d x))^{n+1}}{4 d \left (a^2+b^2\right )}+\frac {b \cos ^2(c+d x) \left (a b \left (\frac {3 a^2}{b^2}-2 n+5\right ) \tan (c+d x)+a^2 (n+1)+b^2 (3-n)\right ) (a+b \tan (c+d x))^{n+1}}{8 d \left (a^2+b^2\right )^2}+\frac {b \left (\frac {a n \left (\frac {3 a^2}{b^2}-2 n+5\right )}{b^2}-\frac {\sqrt {-b^2} \left (3 a^4+a^2 b^2 \left (-n^2-2 n+6\right )+b^4 \left (n^2-4 n+3\right )\right )}{b^6}\right ) (a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right )}{16 d (n+1) \left (\frac {a^2}{b^2}+1\right )^2 \left (a-\sqrt {-b^2}\right )}+\frac {b \left (\frac {a n \left (\frac {3 a^2}{b^2}-2 n+5\right )}{b^2}+\frac {\sqrt {-b^2} \left (3 a^4+a^2 b^2 \left (-n^2-2 n+6\right )+b^4 \left (n^2-4 n+3\right )\right )}{b^6}\right ) (a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right )}{16 d (n+1) \left (\frac {a^2}{b^2}+1\right )^2 \left (a+\sqrt {-b^2}\right )} \]
[In]
[Out]
Rule 70
Rule 755
Rule 837
Rule 845
Rule 3587
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {(a+x)^n}{\left (1+\frac {x^2}{b^2}\right )^3} \, dx,x,b \tan (c+d x)\right )}{b d} \\ & = \frac {\cos ^4(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{4 \left (a^2+b^2\right ) d}-\frac {b \text {Subst}\left (\int \frac {(a+x)^n \left (-3-\frac {3 a^2}{b^2}+n-\frac {a (2-n) x}{b^2}\right )}{\left (1+\frac {x^2}{b^2}\right )^2} \, dx,x,b \tan (c+d x)\right )}{4 \left (a^2+b^2\right ) d} \\ & = \frac {\cos ^4(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{4 \left (a^2+b^2\right ) d}+\frac {b \cos ^2(c+d x) (a+b \tan (c+d x))^{1+n} \left (b^2 (3-n)+a^2 (1+n)+a b \left (5+\frac {3 a^2}{b^2}-2 n\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}+\frac {b^5 \text {Subst}\left (\int \frac {(a+x)^n \left (\frac {3 a^4+a^2 b^2 \left (6-2 n-n^2\right )+b^4 \left (3-4 n+n^2\right )}{b^6}-\frac {a \left (5+\frac {3 a^2}{b^2}-2 n\right ) n x}{b^4}\right )}{1+\frac {x^2}{b^2}} \, dx,x,b \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d} \\ & = \frac {\cos ^4(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{4 \left (a^2+b^2\right ) d}+\frac {b \cos ^2(c+d x) (a+b \tan (c+d x))^{1+n} \left (b^2 (3-n)+a^2 (1+n)+a b \left (5+\frac {3 a^2}{b^2}-2 n\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}+\frac {b^5 \text {Subst}\left (\int \left (\frac {\left (\frac {a \left (5+\frac {3 a^2}{b^2}-2 n\right ) n}{b^2}+\frac {\sqrt {-b^2} \left (3 a^4+a^2 b^2 \left (6-2 n-n^2\right )+b^4 \left (3-4 n+n^2\right )\right )}{b^6}\right ) (a+x)^n}{2 \left (\sqrt {-b^2}-x\right )}+\frac {\left (-\frac {a \left (5+\frac {3 a^2}{b^2}-2 n\right ) n}{b^2}+\frac {\sqrt {-b^2} \left (3 a^4+a^2 b^2 \left (6-2 n-n^2\right )+b^4 \left (3-4 n+n^2\right )\right )}{b^6}\right ) (a+x)^n}{2 \left (\sqrt {-b^2}+x\right )}\right ) \, dx,x,b \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d} \\ & = \frac {\cos ^4(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{4 \left (a^2+b^2\right ) d}+\frac {b \cos ^2(c+d x) (a+b \tan (c+d x))^{1+n} \left (b^2 (3-n)+a^2 (1+n)+a b \left (5+\frac {3 a^2}{b^2}-2 n\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d}-\frac {\left (b^5 \left (\frac {a \left (5+\frac {3 a^2}{b^2}-2 n\right ) n}{b^2}-\frac {\sqrt {-b^2} \left (3 a^4+a^2 b^2 \left (6-2 n-n^2\right )+b^4 \left (3-4 n+n^2\right )\right )}{b^6}\right )\right ) \text {Subst}\left (\int \frac {(a+x)^n}{\sqrt {-b^2}+x} \, dx,x,b \tan (c+d x)\right )}{16 \left (a^2+b^2\right )^2 d}+\frac {\left (b^5 \left (\frac {a \left (5+\frac {3 a^2}{b^2}-2 n\right ) n}{b^2}+\frac {\sqrt {-b^2} \left (3 a^4+a^2 b^2 \left (6-2 n-n^2\right )+b^4 \left (3-4 n+n^2\right )\right )}{b^6}\right )\right ) \text {Subst}\left (\int \frac {(a+x)^n}{\sqrt {-b^2}-x} \, dx,x,b \tan (c+d x)\right )}{16 \left (a^2+b^2\right )^2 d} \\ & = \frac {b^5 \left (\frac {a \left (5+\frac {3 a^2}{b^2}-2 n\right ) n}{b^2}-\frac {\sqrt {-b^2} \left (3 a^4+a^2 b^2 \left (6-2 n-n^2\right )+b^4 \left (3-4 n+n^2\right )\right )}{b^6}\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{16 \left (a^2+b^2\right )^2 \left (a-\sqrt {-b^2}\right ) d (1+n)}+\frac {b^5 \left (\frac {a \left (5+\frac {3 a^2}{b^2}-2 n\right ) n}{b^2}+\frac {\sqrt {-b^2} \left (3 a^4+a^2 b^2 \left (6-2 n-n^2\right )+b^4 \left (3-4 n+n^2\right )\right )}{b^6}\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{16 \left (a^2+b^2\right )^2 \left (a+\sqrt {-b^2}\right ) d (1+n)}+\frac {\cos ^4(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{4 \left (a^2+b^2\right ) d}+\frac {b \cos ^2(c+d x) (a+b \tan (c+d x))^{1+n} \left (b^2 (3-n)+a^2 (1+n)+a b \left (5+\frac {3 a^2}{b^2}-2 n\right ) \tan (c+d x)\right )}{8 \left (a^2+b^2\right )^2 d} \\ \end{align*}
Time = 4.71 (sec) , antiderivative size = 360, normalized size of antiderivative = 0.83 \[ \int \cos ^4(c+d x) (a+b \tan (c+d x))^n \, dx=\frac {(a+b \tan (c+d x))^{1+n} \left (\frac {\frac {\left (a b^2 \left (3 a^2+b^2 (5-2 n)\right ) n+\sqrt {-b^2} \left (-3 a^4-b^4 \left (3-4 n+n^2\right )+a^2 b^2 \left (-6+2 n+n^2\right )\right )\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right )}{a-\sqrt {-b^2}}+\frac {\left (a b^2 \left (3 a^2+b^2 (5-2 n)\right ) n+\sqrt {-b^2} \left (3 a^4+b^4 \left (3-4 n+n^2\right )-a^2 b^2 \left (-6+2 n+n^2\right )\right )\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right )}{a+\sqrt {-b^2}}}{\left (a^2+b^2\right ) (1+n)}+4 b \cos ^4(c+d x) (b+a \tan (c+d x))-\frac {2 b \cos ^2(c+d x) \left (b^3 (-3+n)-a^2 b (1+n)-a \left (3 a^2+b^2 (5-2 n)\right ) \tan (c+d x)\right )}{a^2+b^2}\right )}{16 b \left (a^2+b^2\right ) d} \]
[In]
[Out]
\[\int \left (\cos ^{4}\left (d x +c \right )\right ) \left (a +b \tan \left (d x +c \right )\right )^{n}d x\]
[In]
[Out]
\[ \int \cos ^4(c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cos \left (d x + c\right )^{4} \,d x } \]
[In]
[Out]
\[ \int \cos ^4(c+d x) (a+b \tan (c+d x))^n \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{n} \cos ^{4}{\left (c + d x \right )}\, dx \]
[In]
[Out]
\[ \int \cos ^4(c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cos \left (d x + c\right )^{4} \,d x } \]
[In]
[Out]
\[ \int \cos ^4(c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \cos \left (d x + c\right )^{4} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^4(c+d x) (a+b \tan (c+d x))^n \, dx=\int {\cos \left (c+d\,x\right )}^4\,{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n \,d x \]
[In]
[Out]